

<div class="cpMain">

    <ul class="myCar-list">
        <volist name="cartList" id="cartList">
            <li>
                <div class="arge fl">
                    <input type="checkbox" id="car-{$cartList.id}" name="cart_id[]" onclick="tab_status(this)" data-id="{$cartList.id}" value="{$cartList.id}" <if condition="$cartList.selected eq 1">checked</if>>
                    <label for="car-{$cartList.id}"></label>
                </div>
                <div class="pic fl">
                    <img src="{$cartList.original_img}">
                </div>
                <div class="word fr">
                    <h3 class="t">{$cartList.goods_name}</h3>
                    <div class="f clearfix">
                        <span class="price fl">￥<strong>{$cartList.goods_price}</strong></span>
                        <div class="quantity  fr clearfix">
                            <a href="javascript:;" class="decrease iconfont" onclick="switch_num(-1,{$cartList.id},true)">&#xe6fd;</a>
                            <input id="in{$cartList.id}" type="tel" class="inpt" size="4" name="num[{$cartList.id}]" value="{$cartList.goods_num}" max="{$cartList.store_count}" readonly>
                            <a href="javascript:;" class="increase iconfont" onclick="switch_num(1,{$cartList.id},true)">&#xe71b;</a>
                        </div>
                    </div>
                </div>
            </li>
        </volist>

    </ul>
</div>
<!--main End-->

<!--全选-->
<div class="my-carOpera clearfix" >
    <div class="arge fl">
        <input type="checkbox" name="moren" id="qx" onclick="quanxuan()" <if condition="$cartCount eq $total_price.num">checked</if> >
        <label for="qx">全选</label>
    </div>
    <a href="{:U('Payment/settlement')}" class="go-sett fr">合计：￥<span class="all-Price">{$total_price.total_fee}</span>，结算（{$total_price.num}）</a>
</div>
<!--全选 End-->


<script>
    function tab_status(obj){
        var item_id = $(obj).attr('data-id');
        $.ajax({
            type: 'post',
            url: "/Home/Cart/tab_status.html",
            data: {item_id:item_id},
            dataType: 'json',
            success: function (data) {
                if (data.status == 200) {
                    CartList();
                }
            }
        })
    }

    function quanxuan(){
        var status = $("#qx").prop("checked");
        var selected;
        if (status == true){
            selected = 1;
        }
        if (status == false){
            selected = 0;
        }
        $.ajax({
            type: 'post',
            url: "/Home/Cart/tab_qx.html",
            data: {selected:selected},
            dataType: 'json',
            success: function (data) {
                if (data.status == 200) {
                    CartList();
                }
            }
        })
    }
</script>